import KY3D from '@/editor/KY3D';
import React, { useEffect, useRef } from 'react'
import styled from 'styled-components'

const IdcPanelBox = styled.div`
    position: relative;
    top: 0;
    left: 0;
    width: 240px;
    height: 208px;
    background-color: rgb(54,54,54);
`

const HudPanel = () => {

    const hud = useRef(null);

    useEffect(()=>{
    
        // 挂载
        if(hud){
            KY3D.hud = hud.current;
            KY3D.SC.scene.mountedHudScene();
            console.log('hud mount')
        }
        // 卸载
        return ()=>{
            console.log('hud unmount')
        }
    })

    return (
        <>
            <IdcPanelBox ref={hud}>

            </IdcPanelBox>
        </>
    )
}

export default HudPanel